﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
using BUS;

namespace BUS
{
    public class SanPhamThietKeBus
    {
        public static bool ThemSanPhamThietKe(SanPhamThietKeDto one)
        {
            bool result = false;
            if (SanPhamThietKeDao.kiemtraTonTai(one) == false)
                result = SanPhamThietKeDao.ThemSanPhamThietKe(one);
            
            return result;
        }
        
        public static bool XoaSanPhamThietKe(SanPhamThietKeDto one)
        {
            bool result = false;
            if (SanPhamThietKeDao.kiemtraTonTai(one) == true)
                result = SanPhamThietKeDao.XoaSanPhamThietKe(one);

            return result;
        }
        
        public static bool CapnhatSanPhamThietKe(SanPhamThietKeDto one)
        {
            bool result = false;
            if (SanPhamThietKeDao.kiemtraTonTai(one) == true)
                result = SanPhamThietKeDao.CapnhatSanPhamThietKe(one);

            return result;
        }

        public static List<SanPhamThietKeDto> LayDanhSachSanPhamThietKeCuaNguoiDung(int IDnguoidung)
        {
            return SanPhamThietKeDao.LayDanhSachSanPhamThietKeCuaNguoiDung(IDnguoidung);
        }

        public static SanPhamThietKeDto LaySanPhamThietKeTheoID(int ID)
        {
            return SanPhamThietKeDao.LaySanPhamThietKeTheoID(ID);
        }

    }
}
